import React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { ConfigProvider } from 'antd'; // 如果使用Ant Design
import { ErrorBoundary } from 'react-error-boundary';
// 布局组件
import AppLayout from './layouts/AppLayout.jsx';

// 页面组件
import HomePage from './pages/Home';
import ChatAgent from './pages/ChatAgent';

// 错误边界组件
import ErrorFallback from './components/common/ErrorFallback';

// 样式
import './styles/global.css';

function App() {
    return (
        <ErrorBoundary FallbackComponent={ErrorFallback}>
            <ConfigProvider>
                <Router>
                    <AppLayout>
                        <Routes>
                            <Route path="/" element={<ChatAgent />} />
                        </Routes>
                    </AppLayout>
                </Router>
            </ConfigProvider>
        </ErrorBoundary>
    );
}

export default App;